﻿using Resn.WhuPub.BIL;
using Resn.WhuPub.DML;
using System;

namespace Resn.WhuPub.BLL
{
        /// <summary>
        /// 实现拜访的属性和方法
        /// </summary>
        public class TravelVisit : Entity,ITravelVisit
        {
                #region 构造函数

                public TravelVisit(TravelVisitModel model)
                {
                        Model = model;
                }

                #endregion


                #region 属性

                #region 基本属性

                

                /// <summary>
                /// 获取所属差旅标识
                /// </summary>
                /// <value>
                /// 所属差旅标识
                /// </value>
                public string TravelId
                {
                        get
                        {
                                return Model.TravelId;
                        }
                }

                /// <summary>
                /// 获取联系人标识
                /// </summary>
                /// <value>
                /// 所属联系人标识
                /// </value>
                public string ContactId
                {
                        get
                        {
                                return Model.ContactId;
                        }
                }

                /// <summary>
                /// 获取或设置开始时间
                /// </summary>
                /// <value>
                /// 开始时间
                /// </value>
                public DateTime StartTime
                {
                        get
                        {
                                return Model.StartTime;
                        }
                        set
                        {
                                Model.StartTime = value;
                        }
                }

                /// <summary>
                /// 获取或设置结束时间
                /// </summary>
                /// <value>
                /// 结束时间
                /// </value>
                public DateTime EndTime
                {
                        get
                        {
                                return Model.EndTime;
                        }
                        set
                        {
                                Model.EndTime = value;
                        }
                }

                /// <summary>
                /// 获取或设置拜访方式
                /// </summary>
                /// <value>
                /// 拜访方式
                /// </value>
                public VisitType VisitType
                {
                        get
                        {
                                return (VisitType)Enum.Parse(typeof(VisitType), Model.VisitType);
                        }
                        set
                        {
                                Model.VisitType = value.ToString();
                        }
                }

                /// <summary>
                /// 获取或设置拜访目的
                /// </summary>
                /// <value>
                /// 拜访目的
                /// </value>
                public string Objective
                {
                        get
                        {
                                return Model.Objective;
                        }
                        set
                        {
                                Model.Objective = value;
                        }
                }

                /// <summary>
                /// 获取或设置拜访重点事件
                /// </summary>
                /// <value>
                /// 拜访重点事件
                /// </value>
                public string KeyPoints
                {
                        get
                        {
                                return Model.KeyPoints;
                        }
                        set
                        {
                                Model.KeyPoints = value;
                        }
                }

                /// <summary>
                /// 获取或设置宴请消费金额
                /// </summary>
                /// <value>
                /// 宴请消费金额
                /// </value>
                public Double EatAmount
                {
                        get
                        {
                                return Model.EatAmount;
                        }
                        set
                        {
                                Model.EatAmount = value;
                        }
                }

                /// <summary>
                /// 获取或设置礼品消费金额
                /// </summary>
                /// <value>
                /// 礼品消费金额
                /// </value>
                public Double GiftAmount
                {
                        get
                        {
                                return Model.GiftAmount;
                        }
                        set
                        {
                                Model.GiftAmount = value;
                        }
                }

                /// <summary>
                /// 获取或设置录入时间
                /// </summary>
                /// <value>
                /// 录入时间
                /// </value>
                public DateTime EnteringTime
                {
                        get
                        {
                                return Model.EnteringTime;
                        }
                        set
                        {
                                Model.EnteringTime = value;
                        }
                }

                /// <summary>
                /// 获取或设置备注
                /// </summary>
                /// <value>
                /// 备注
                /// </value>
                public string Memo
                {
                        get
                        {
                                return Model.Memo;
                        }
                        set
                        {
                                Model.Memo = value;
                        }
                }

                #endregion 基本属性

                /// <summary>
                /// 获取拜访模型
                /// </summary>
                /// <value>
                /// 拜访模型
                /// </value>
                public TravelVisitModel Model { get; private set; }

                #endregion 属性

                #region 方法

                /// <summary>
                /// 获取指定标识的对象
                /// </summary>
                /// <param name="id">标识</param>
                /// <returns></returns>
                public static TravelVisit Select(string id)
                {
                        return Select<TravelVisit, TravelVisitModel>(id);
                }

                #endregion

        }
}